home *** CD-ROM | disk | FTP | other *** search
- Path: hubcap.clemson.edu!hubcap!mjs
- From: mjs@hubcap.clemson.edu (M. J. Saltzman)
- Newsgroups: comp.lang.c
- Subject: Re: void pointers
- Date: 12 Jan 96 22:52:07 GMT
- Organization: Clemson University
- Message-ID: <mjs.821487127@hubcap>
- References: <1996Jan12.133322.1@ccc.govt.nz> <4d6h8k$p6u@axe.netdoor.com>
- NNTP-Posting-Host: hubcap.clemson.edu
-
- esargent@netdoor.com (Eric Sargent) writes:
-
- >mcauslanb@ccc.govt.nz wrote:
-
- >>I am writing a C program for an application that has a development language
- >>based on ANSI C.
-
- >>A function that I need to call is defined:
- >> void getFence (void **clipPP);
-
- >> where "clipPP" is returned by the function.
-
- >>1) How do I declare and pass clipPP?
-
- >void (char, etc..) *clipPP;
-
- >getFence(&clipPP); (may need to be cast if not a void pointer)
-
- Casting a pointer to non-void pointer to some other type here is an error!
-
- Since the code in the body of getFence() assumes that it will deposit
- a void pointer, if you pass the address of another type of pointer
- (perhaps with a different size), getFence will write a value in the
- wrong format for that type of pointer.
- --
- Matthew Saltzman
- Clemson University Math Sciences
- mjs@clemson.edu
-